package nc.lfw.finance.quickdesk;

import nc.lfw.core.model.ConfigurationPageModel;
import nc.lfw.core.page.PageMeta;
import nc.lfw.data.Dataset;
import nc.lfw.data.PaginationInfo;
import nc.lfw.finance.util.WebbxServerConfig;

public class QuickdeskPageModel extends ConfigurationPageModel {

	@Override
	public PageMeta createPageMeta() {
		PageMeta meta = super.createPageMeta();
		Dataset[] dss = meta.getViewModel().getDatasets();
		String isPagination = WebbxServerConfig.getInstance().getIsPagination();
		if(isPagination != null && "Y".equals(isPagination.toUpperCase())){
			for(Dataset ds : dss){
				PaginationInfo p = ds.getPaginationInfo();
				int size = WebbxServerConfig.getInstance().getPaginationSize();
				p.setPageSize(size);
			}
		}
		return meta;
	}

}
